package com.jeff.cloud.consumermovie.feign;

import com.jeff.cloud.consumermovie.bean.User;
import feign.Param;
import feign.RequestLine;
import org.omg.CORBA.Request;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 使用@FeignClient的configuration属性，指定feign的配置类
 * @author: jeff
 * @date: 2021/8/9 14:36
 */
@FeignClient(name="microservice-provider-user", configuration = FeignConfiguration.class)
public interface UserFeignClient {
    /**
     * 使用feign自带的注解@RequestLine
     * @see https://github.com/OpenFeign/feign
     * @param id
     * @return
     */
    @RequestLine("GET /{id}")
    public User findById(@Param("id") Long id);


    /*@RequestMapping(value="/{id}",method = RequestMethod.GET)
    public User findById(@PathVariable("id") Long id);*/
}
